package homework0708;

import homework0708_jk.GuessingGameService;

//实现判断接口
public class GuessingGameServiceImpl implements GuessingGameService {
    @Override
    public String judge(int cptNum, int iptNum) {
        String result = "";
        if (iptNum == cptNum) {
            result = "平局";
        } else if (iptNum == 0 && cptNum == 1 || iptNum == 1 && cptNum == 2 || iptNum == 2 && cptNum == 0) {
            result = "win";
        } else if (iptNum == 0 && cptNum == 2 || iptNum == 1 && cptNum == 0 || iptNum == 2 && cptNum == 1) {
            result = "lose";
        }
        return result;
    }
}
